package com.sztest.jayjun.ui;

import android.content.Intent;
import android.view.View;

import com.sztest.jayjun.R;
import com.sztest.jayjun.base.BaseActivity;
import com.sztest.jayjun.databinding.ActivitySettingBinding;
import com.sztest.jayjun.dialog.SelectLanguageDialog;
import com.sztest.jayjun.dialog.UpdateAppDialog;
import com.sztest.jayjun.dialog.VolumeDialog;

import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

/*
 *  @项目名：  jayjun
 *  @包名：    com.sztest.jayjun.ui
 *  @文件名:   SettingsActivity
 *  @创建者:   okmin
 *  @创建时间:  2022/6/27 17:10
 *  @描述：    TODO
 */
public class SettingsActivity extends BaseActivity {

    private ActivitySettingBinding mViewDataBinding;
    private SelectLanguageDialog mSelectLanguageDialog;
    private VolumeDialog mVolumeDialog;
    private UpdateAppDialog mUpdateAppDialog;

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        mViewDataBinding.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        mViewDataBinding.settingLanguage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mSelectLanguageDialog==null) {
                    mSelectLanguageDialog = new SelectLanguageDialog(mContext);
                }
                mSelectLanguageDialog.show();
            }
        });

        mViewDataBinding.settingVolume.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mVolumeDialog==null) {
                    mVolumeDialog = new VolumeDialog(mContext);
                }
                mVolumeDialog.show();
            }
        });

        mViewDataBinding.settingUpdate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mUpdateAppDialog==null) {
                    mUpdateAppDialog = new UpdateAppDialog(mContext);
                }
                mUpdateAppDialog.show();
            }
        });

        mViewDataBinding.settingAboutme.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(mContext,AboutMeActivity.class));
            }
        });
    }

    @Override
    protected void setDataBinding() {
        mViewDataBinding = DataBindingUtil.setContentView(this, R.layout.activity_setting);
    }


}
